//
//  SYS_StoreAddressCell.m
//  System_App
//
//  Created by 魏配军 on 2017/12/5.
//  Copyright © 2017年 czy001. All rights reserved.
//

#import "SYS_StoreAddressCell.h"

@implementation SYS_StoreAddressCell

-(instancetype)initWithTableView:(UITableView *)tableView  reuseId:(NSString *)reuseId
{
    
    SYS_StoreAddressCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseId];
    if (!cell) {
        cell=[[SYS_StoreAddressCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseId];
    }
    return cell;
}

-(instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self=[super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addView];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
    }
    return self;
}

-(void) addView
{
    _iconImageView=[UIImageView new];
    _iconImageView.layer.masksToBounds=YES;
    _iconImageView.layer.cornerRadius=20;
    
    _nameLabel=[[UILabel alloc]init];
    _nameLabel.textAlignment=NSTextAlignmentLeft;
    _nameLabel.font=[UIFont fontWithName:@"PingFangSC-Regular" size:15];
    _nameLabel.font=[UIFont systemFontOfSize:15];
    _nameLabel.textColor=DGHColorAlpha(20, 20, 20, 1);
    
    
    _lineView=[UIView new];
    _lineView.backgroundColor=DGHColor(221, 221, 221);
    
    [self.contentView sd_addSubviews:@[_iconImageView,_nameLabel,_lineView]];
    
    _iconImageView.sd_layout
    .leftSpaceToView(self.contentView, 10)
    .topSpaceToView(self.contentView, 5)
    .widthIs(40)
    .heightIs(40);
    
    _nameLabel.sd_layout
    .leftSpaceToView(_iconImageView, 10)
    .topSpaceToView(self.contentView, 15)
    .widthIs(SCREENWIDTH-70)
    .heightIs(20);
    
    _lineView.sd_layout
    .leftSpaceToView(self.contentView, 0)
    .bottomEqualToView(self.contentView)
    .widthIs(SCREENWIDTH)
    .heightIs(0.5);
    
}

-(void)setEmployeeModel:(SYS_EmployeeList *)employeeModel
{
    _employeeModel=employeeModel;
    [_iconImageView sd_setImageWithURL:[NSURL URLWithString:_employeeModel.userLogo] placeholderImage:[UIImage imageNamed:@"public_people"]];
    _nameLabel.text=_employeeModel.employeesName;

}









@end
